﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <script src="~/Areas/Back/lib/layui/layui.js"></script>
    <link href="~/Areas/Back/lib/css/layui.css" rel="stylesheet" />
    <title>编辑</title>
</head>
<body>
    <div class="layui-container" style="margin-top:20px; margin-bottom:150px">
        @*onsubmit="return false" 禁止form表单提交，我们要使用ajax*@
        <form class="layui-form" id="addForm" onsubmit="return false">
            <input type="hidden" id="Id" value="@ViewBag.A.Id">
            @*企业介绍*@
            <div class="layui-form-item">
                <label class="layui-form-label">企业介绍</label>
                <div class="layui-input-block">
                    <input type="text" value="@ViewBag.A.JieShao" id="JieShao" class="layui-input" />
                </div>
            </div>
            @*招商电话*@
            <div class="layui-form-item">
                <label class="layui-form-label">招商电话</label>
                <div class="layui-input-block">
                    <input type="text" value="@ViewBag.A.ZsTel" id="ZsTel" class="layui-input" />
                </div>
            </div>
            @*公司电话*@
            <div class="layui-form-item">
                <label class="layui-form-label">公司电话</label>
                <div class="layui-input-block">
                    <input type="text" value="@ViewBag.A.LxTel" id="LxTel" class="layui-input" />
                </div>
            </div>
            @*公司邮箱*@
            <div class="layui-form-item">
                <label class="layui-form-label">公司邮箱</label>
                <div class="layui-input-block">
                    <input type="text" value="@ViewBag.A.Email" id="Email" class="layui-input" />
                </div>
            </div>
            @*公司地址*@
            <div class="layui-form-item">
                <label class="layui-form-label">公司地址</label>
                <div class="layui-input-block">
                    <input type="text" value="@ViewBag.A.Address" id="DiZhi" class="layui-input" />
                </div>
            </div>
            @*公司详情*@
            <div class="layui-form-item">
                <label class="layui-form-label">公司详情</label>
                <div class="layui-input-block">
                    <input type="text" value="@ViewBag.A.Info" id="Info" class="layui-input" />
                </div>
            </div>
            @*企业文化*@
            <div class="layui-form-item">
                <label class="layui-form-label">企业文化</label>
                <div class="layui-input-block">
                    <input type="text" value="@ViewBag.A.WenHua" id="WenHua" class="layui-input" />
                </div>
            </div>
            @*经纬度*@
            <div class="layui-form-item">
                <label class="layui-form-label">经度</label>
                <div class="layui-input-inline">
                    <input type="text" value="@ViewBag.A.X" id="X" class="layui-input" />
                </div>
                <label class="layui-form-label">纬度</label>
                <div class="layui-input-inline">
                    <input type="text" value="@ViewBag.A.Y" id="Y" class="layui-input" />
                </div>
            </div>
            @*按钮*@
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="subAdd">提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
</body>
<script>
    layui.use(['form','layedit','upload'], function () {
        var form = layui.form;
        var layedit = layui.layedit;
        var upload = layui.upload;
        var layer = layui.layer;
        var $ = layui.$;
        //开始处理点击提交
        form.on('submit(subAdd)', function () {
            //ajax请求
            $.ajax({
                url: "EditDel",
                method: "post",
                dataType: "json",
                data: {
                    Id: $("#Id").val(),
                    JieShao: $("#JieShao").val(),
                    ZsTel: $("#ZsTel").val(),
                    LxTel: $("#LxTel").val(),
                    Email: $("#Email").val(),
                    Info: $("#Info").val(),
                    Address: $("#Address").val(),
                    WenHua: $("#WenHua").val(),
                    X: $("#X").val(),
                    Y: $("#Y").val()
                },
                success: function (res) {
                    if (res.success == true) {
                        layer.msg(res.msg);
                        //关闭当前窗口，并且刷新列表
                        //1.获取弹窗的编号
                        var index = parent.layer.getFrameIndex(window.name);
                        //2.关闭窗口
                        parent.layer.close(index);
                        //3.刷新父级页面
                        parent.location.reload();
                    }
                    else {
                        layer.msg(res.msg);
                    }
                }
            });
            return false;
        });
    });
</script>
</html>
